; *** Alquerque
; *** Copyright 1998-2002 Zillions Development
; v.2.0

; You need to purchase Zillions of Games to load this rules file
; Visit the Zillions web site at http://www.zillions-of-games.com

(version "2.0")
(translate
 ("Alquerque" "阿拉伯跳棋 (Alquerque)")
 ("Lau Kati Kata" "印度跳棋 (Lau Kata Kati)")
 ("Sixteen Soldiers" "十六子跳棋 (Sixteen Soldiers)")
 ("Quadruple Alquerque" "大型阿拉伯跳棋 (Quadruple Alquerque)")
)
(define shift  ($1 (verify empty?) add) )
(define jump   ($1 (verify enemy?) capture $1 (verify empty?) (add-partial capturing)) )

(game
    (title "Alquerque")
    (description "棋子可以沿线移动1格。或跳过相邻的对方子至其后的相邻空格，并把跳过的子吃掉。\\可以连吃，且能吃子时必须吃子。\\吃光对手获胜。")
    (history "Alquerque, an Arab game, was the forerunner of checkers.  It dates
       back at least to the 10th century, though a board showing this pattern was
       found in an Egyptian temple dated before 1300 B.C.   The game spread to Spain,
       where it appeared in the 13th Century `Book of Games` compiled under the
       direction of King Alfonso X of Castile.    The Alquerque board has also been
       used in other games in double and quadruple form; a double Alquerque board
       is used in the Malagasy game Fanorona.")
    (strategy "As in most checkers variants, look for opportunities to make favorable
       exchanges of captures (two for one and three for two).   Pieces on the center
       point and the four diagonally adjacent points are very mobile; pieces on the
       edges, though seeming less vulnerable to capture, are actually less mobile and
       easier to trap.")
    (option "prevent flipping" 2)
    (move-sound "Audio\\Metal3.wav")
    (release-sound "Audio\\Metal3.wav")
    (players White Black)
    (turn-order White Black)
    (move-priorities capturing moving)
    (board
        (image "images\Alquerque\Alquerque2.bmp" "images\Alquerque\Alquerque.bmp")
        (grid
            (start-rectangle 0 0 30 30); top-left position
            (dimensions ;5 x 5
                ("A/B/C/D/E" (32 0)) ; columns
                ("5/4/3/2/1" (0 32)) ; rows
			)
			(directions (n 0 -1) (s 0 1) (e 1 0) (w -1 0))
		)
        (links ne (A1 B2) (A3 B4) (B2 C3) (B4 C5)
                  (C1 D2) (C3 D4) (D2 E3) (D4 E5)
        )
        (links nw (B2 A3) (B4 A5) (C1 B2) (C3 B4)
                  (D2 C3) (D4 C5) (E1 D2) (E3 D4)
        )
        (links sw (B2 A1) (B4 A3) (C3 B2) (C5 B4)
                  (D2 C1) (D4 C3) (E3 D2) (E5 D4)
        )
        (links se (A3 B2) (A5 B4) (B2 C1) (B4 C3)
                  (C3 D2) (C5 D4) (D2 E1) (D4 E3)
        )
	)
    (piece
        (image White "images\Alquerque\GrayCircle.bmp"
			   Black "images\Alquerque\BrownCircle.bmp")
        (name man)
		(help "Man: steps along lines, jumps to capture and can keep capturing")
		(moves
			(move-type capturing)
			(jump n)
			(jump s)
			(jump e)
			(jump w)
			(jump ne)
			(jump nw)
			(jump se)
			(jump sw)

			(move-type moving)
			(shift n)
			(shift s)
			(shift e)
			(shift w)
			(shift ne)
			(shift nw)
			(shift se)
			(shift sw)
		)			
	)

    (board-setup
        (Black (man
           A5 B5 C5 D5 E5
           A4 B4 C4 D4 E4
           A3 B3
		))
		(White (man
                    D3 E3
           A2 B2 C2 D2 E2
           A1 B1 C1 D1 E1
		))
	)

    (loss-condition (White Black) (pieces-remaining 0))
)


(variant
    (title "Lau Kati Kata")
    (history "Lau Kati Kata is an form of Alquerque on a modified board, found in
        India and southern Asia.")
    (board
        (image "images\Alquerque\LauKatiKata2.bmp" "images\Alquerque\LauKatiKata.bmp")
		(positions (Center 53 43 73  65)
		           (LL5  11   7  31  27)
		           (LL3   4  40  24  68)
				   (LL1  11  81  31 101)
				   (L4   31  22  51  42)
				   (L3   26  43  50  65)
				   (L2   31  66  51  86)
				   (RR5  94   7 114  27)
		           (RR3 102  40 122  68)
				   (RR1  94  81 114 101)
				   (R4   76  22  96  42)
				   (R3   78  43 100  65)
				   (R2   76  66  96  86)
		)
		(links n (LL1 LL3) (LL3 LL5)
		         (L2 L3) (L3 L4)
				 (RR1 RR3) (RR3 RR5)
				 (R2 R3) (R3 R4)
		)
		(links s (LL5 LL3) (LL3 LL1)
		         (L4 L3) (L3 L2)
				 (RR5 RR3) (RR3 RR1)
				 (R4 R3) (R3 R2)
		)
		(links e (LL3 L3) (L3 Center)
		         (Center R3) (R3 RR3)
		)
		(links w (Center L3) (L3 LL3)
		         (RR3 R3) (R3 Center)
		)
        (links ne (LL1 L2) (L2 Center)
				  (Center R4) (R4 RR5)
        )
        (links nw (Center L4) (L4 LL5)
				  (RR1 R2) (R2 Center)
        )
        (links sw (Center L2) (L2 LL1)
				  (RR5 R4) (R4 Center)
        )
        (links se (LL5 L4) (L4 Center)
				  (Center R2) (R2 RR1)
        )
	)
    (board-setup
        (Black (man R2 R3 R4 RR1 RR3 RR5))
		(White (man L2 L3 L4 LL1 LL3 LL5))
	)
)

(variant
    (title "Sixteen Soldiers")
    (history "Sixteen Soldiers is a version of Alquerque played in Sri Lanka and
       Southern India on a modified board.    Other games with similar names and
       slightly different boards are played in China.   Some of the games, like
       Cows and Leopards, pit one or a few powerful pieces against a larger force,
       and are more closely related to Fox and Geese.")
    (board
        (image "images\Alquerque\Sixteen2.bmp" "images\Alquerque\Sixteen.bmp")
        (grid
            (start-rectangle 53 4 77 30); top-left position
            (dimensions ;5 x 5
                ("A/B/C/D/E" (32 0)) ; columns
                ("5/4/3/2/1" (0 32)) ; rows
			)
			(directions (n 0 -1) (s 0 1) (e 1 0) (w -1 0))
		)
		(positions (LL5  13  33  33  53)
		           (LL3   5  67  25  95)
				   (LL1  13 109  33 129)
				   (L4   33  49  53  69)
				   (L3   26  70  50  92)
				   (L2   33  93  53 113)
				   (RR5 225  33 245  53)
		           (RR3 231  67 252  93)
				   (RR1 225 109 245 129)
				   (R4  205  49 225  69)
				   (R3  206  70 230  92)
				   (R2  205  93 225 113)
		)
		(links n (LL1 LL3) (LL3 LL5)
		         (L2 L3) (L3 L4)
				 (RR1 RR3) (RR3 RR5)
				 (R2 R3) (R3 R4)
		)
		(links s (LL5 LL3) (LL3 LL1)
		         (L4 L3) (L3 L2)
				 (RR5 RR3) (RR3 RR1)
				 (R4 R3) (R3 R2)
		)
		(links e (LL3 L3) (L3 A3)
		         (E3 R3) (R3 RR3)
		)
		(links w (A3 L3) (L3 LL3)
		         (RR3 R3) (R3 E3)
		)
        (links ne (A1 B2) (A3 B4) (B2 C3) (B4 C5)
                  (C1 D2) (C3 D4) (D2 E3) (D4 E5)
				  (LL1 L2) (L2 A3)
				  (E3 R4) (R4 RR5)
        )
        (links nw (B2 A3) (B4 A5) (C1 B2) (C3 B4)
                  (D2 C3) (D4 C5) (E1 D2) (E3 D4)
				  (A3 L4) (L4 LL5)
				  (RR1 R2) (R2 E3)
        )
        (links sw (B2 A1) (B4 A3) (C3 B2) (C5 B4)
                  (D2 C1) (D4 C3) (E3 D2) (E5 D4)
				  (A3 L2) (L2 LL1)
				  (RR5 R4) (R4 E3)
        )
        (links se (A3 B2) (A5 B4) (B2 C1) (B4 C3)
                  (C3 D2) (C5 D4) (D2 E1) (D4 E3)
				  (LL5 L4) (L4 A3)
				  (E3 R2) (R2 RR1)
        )
	)
    (board-setup
        (Black (man
           D5 E5    RR5
		   D4 E4 R4
		   D3 E3 R3 RR3
		   D2 E2 R2
		   D1 E1    RR1
		))
		(White (man
           LL5    A5 B5
		       L4 A4 B4
		   LL3 L3 A3 B3
		       L2 A2 B2
		   LL1    A1 B1
		))
	)
)

(variant
    (title "Quadruple Alquerque")
    (history "Quadruple Alquerque is an enlarged form of Alquerque played on a
       board formed from four regular Alquerque boards.")
    (board
        (image "images\Alquerque\QAlquerque2.bmp" "images\Alquerque\QAlquerque.bmp")
        (grid
            (start-rectangle -1 -1 29 29); top-left position
            (dimensions ; 9 x 9
                ("A/B/C/D/E/F/G/H/I" (32 0)) ; columns
                ("9/8/7/6/5/4/3/2/1" (0 32)) ; rows
			)
			(directions (n 0 -1) (s 0 1) (e 1 0) (w -1 0))
		)
        (links ne (A1 B2) (A3 B4) (A5 B6) (A7 B8)
                  (B2 C3) (B4 C5) (B6 C7) (B8 C9)
                  (C1 D2) (C3 D4) (C5 D6) (C7 D8)
                  (D2 E3) (D4 E5) (D6 E7) (D8 E9)
                  (E1 F2) (E3 F4) (E5 F6) (E7 F8)
                  (F2 G3) (F4 G5) (F6 G7) (F8 G9)
                  (G1 H2) (G3 H4) (G5 H6) (G7 H8)
                  (H2 I3) (H4 I5) (H6 I7) (H8 I9)
        )
        (links nw (B2 A3) (B4 A5) (B6 A7) (B8 A9)
                  (C1 B2) (C3 B4) (C5 B6) (C7 B8)
                  (D2 C3) (D4 C5) (D6 C7) (D8 C9)
                  (E1 D2) (E3 D4) (E5 D6) (E7 D8)
                  (F2 E3) (F4 E5) (F6 E7) (F8 E9)
                  (G1 F2) (G3 F4) (G5 F6) (G7 F8)
                  (H2 G3) (H4 G5) (H6 G7) (H8 G9)
                  (I1 H2) (I3 H4) (I5 H6) (I7 H8)
        )
        (links sw (B2 A1) (B4 A3) (B6 A5) (B8 A7)
                  (C3 B2) (C5 B4) (C7 B6) (C9 B8)
                  (D2 C1) (D4 C3) (D6 C5) (D8 C7)
                  (E3 D2) (E5 D4) (E7 D6) (E9 D8)
                  (F2 E1) (F4 E3) (F6 E5) (F8 E7)
                  (G3 F2) (G5 F4) (G7 F6) (G9 F8)
                  (H2 G1) (H4 G3) (H6 G5) (H8 G7)
                  (I3 H2) (I5 H4) (I7 H6) (I9 H8)
        )
        (links se (A3 B2) (A5 B4) (A7 B6) (A9 B8)
                  (B2 C1) (B4 C3) (B6 C5) (B8 C7)
                  (C3 D2) (C5 D4) (C7 D6) (C9 D8)
                  (D2 E1) (D4 E3) (D6 E5) (D8 E7)
                  (E3 F2) (E5 F4) (E7 F6) (E9 F8)
                  (F2 G1) (F4 G3) (F6 G5) (F8 G7)
                  (G3 H2) (G5 H4) (G7 H6) (G9 H8)
                  (H2 I1) (H4 I3) (H6 I5) (H8 I7)
        )
	)
    (board-setup
        (Black (man
           A9 B9 C9 D9 E9 F9 G9 H9 I9
           A8 B8 C8 D8 E8 F8 G8 H8 I8
           A7 B7 C7 D7 E7 F7 G7 H7 I7
           A6 B6 C6 D6 E6 F6 G6 H6 I6
           A5 B5 C5 D5
		))
		(White (man
                          F5 G5 H5 I5
           A4 B4 C4 D4 E4 F4 G4 H4 I4
           A3 B3 C3 D3 E3 F3 G3 H3 I3
           A2 B2 C2 D2 E2 F2 G2 H2 I2
           A1 B1 C1 D1 E1 F1 G1 H1 I1
		))
	)
)
